<template>
  <div>
    <el-empty v-if="auditLogLength == 0" description="还没有审批记录"></el-empty>
    <el-timeline v-else :reverse="true" style="margin-top: 20px;">
      <el-timeline-item v-for="(item, index) in form.auditLogVoList" :key="index" v-if="item.type == 2">
        <div style="display: flex; justify-content: space-between; align-items: center;">
          <div style="display: flex;">
            <div>管理员 ({{ item.auditNickName }}) 审批</div>
            <!--<div v-if="item.auditLevel == 1">带教秘书 ({{ item.auditNickName }}) 审批</div>
            <div v-if="item.auditLevel == 2">科室负责人 ({{ item.auditNickName }}) 审批</div>
            <div v-if="item.auditLevel == 3">管理员 ({{ item.auditNickName }}) 审批</div>-->
            <el-tag style="margin-left: 15px;" v-if="item.auditStatus == 1" size="mini" effect="dark" type="success">
              已通过
            </el-tag>
            <el-tag style="margin-left: 15px;" v-if="item.auditStatus == 3" size="mini" effect="dark" type="danger">
              已拒绝
            </el-tag>
          </div>
          <div>{{ parseTime(item.createTime) }}</div>
        </div>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
import { getRegisterInfo } from '@/api/business/registerInfo'

export default {
  props: {
    registerId: null
  },
  data() {
    return {
      baseURL: process.env.VUE_APP_BASE_API,
      auditLogLength: 0,
      form: {
        auditLogVoList: []
      }
    }
  },
  mounted() {
    this.getInfo()
  },
  methods: {
    getInfo() {
      getRegisterInfo(this.registerId).then(response => {
        this.form = response.data
        if (this.form.auditLogVoList) {
          this.auditLogLength = this.form.auditLogVoList.filter(e => e.type == 2).length
        }
      })
    }
  }
}
</script>
<style lang="scss" scoped>

</style>
